namespace OasisCiq.Xnl
{
    using System;
    using System.Linq;

    /// <summary>
    /// A list of person name element types, e.g. First Name, Last Name, Title, etc.
    /// </summary>
    public class PersonNameElementList : XS.XSNormalizedString
    {
        private static readonly string[] PossibleValues = new[] 
        {
            "PrecedingTitle", // His Excellency, Honorable, etc
            "Title", // A title signifies some sort of status, such as Mr, Miss, Ms (marriage status), or education such as Professor, PhD, Dr, etc.
            "FirstName", // The most important name element by which this particular individual is identified in the group. E.g. John, Sam, Brian for Anglo-Saxon cultures.
            "MiddleName", // Name elements related to additional identification of the individual, such as names are parents or places.
            "LastName", // Name element that identifies the group the individual belongs to and is identified by, such as Last Name, Surname, Family Name, etc.
            "OtherName", // Any other additional names that are not directly used to identify or call the individual, such as names of ancestors, saints, etc.
            "Alias", // A simple nick name that is commonly used as part of the name. E.g. a fancy kick-boxer can be commonly known as Bill "Storm" Bababoons, where "Storm" is obviously an alias.
            "GenerationIdentifier", // Junior, Senior, The Second, IV, etc.
            "Degree"
        };

        public PersonNameElementList(string value)
            : base(value)
        {
            if (!PossibleValues.Contains(value))
            {
                throw new ArgumentOutOfRangeException();
            }
        }
    }
}